home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / interp / perl5.005.tar.gz / perl5.005.tar / perl5.005 / Policy_sh.SH < prev    next >
Text File  |  1998-07-06  |  5KB  |  154 lines

  1. case $CONFIG in
  2. '') . ./config.sh ;;
  3. esac
  4. echo "Extracting Policy.sh (with variable substitutions)"
  5. $spitshell <<!GROK!THIS! >Policy.sh
  6. $startsh
  7. #
  8. #  This file was produced by running the Policy_sh.SH script, which
  9. #  gets its values from config.sh, which is generally produced by
  10. #  running Configure.  The Policy.sh file gets overwritten each time
  11. #  Configure is run.  Any variables you add to Policy.sh will be lost
  12. #  unless you copy Policy.sh somewhere else before running Configure.
  13. #
  14. #  The idea here is to distill in one place the common site-wide
  15. #  "policy" answers (such as installation directories) that are
  16. #  to be "sticky".  If you keep the file Policy.sh around in
  17. #  the same directory as you are building Perl, then Configure will
  18. #  (by default) load up the Policy.sh file just before the
  19. #  platform-specific hints file.
  20. #
  21.  
  22. #  Allow Configure command-line overrides; usually these won't be
  23. #  needed, but something like -Dprefix=/test/location can be quite
  24. #  useful for testing out new versions.
  25.  
  26. #Site-specific values:
  27.  
  28. case "\$perladmin" in
  29. '') perladmin='$perladmin' ;;
  30. esac
  31.  
  32. # Installation prefix.  Allow a Configure -D override.  You
  33. # may wish to reinstall perl under a different prefix, perhaps
  34. # in order to test a different configuration.
  35. case "\$prefix" in
  36. '') prefix='$prefix' ;;
  37. esac
  38.  
  39. # Installation directives.  Note that each one comes in three flavors.
  40. # For example, we have privlib, privlibexp, and installprivlib.
  41. # privlib is for private (to perl) library files.
  42. # privlibexp is the same, except any '~' the user gave to Configure
  43. #     is expanded to the user's home directory.  This is figured
  44. #     out automatically by Configure, so you don't have to include it here.
  45. # installprivlib is for systems (such as those running AFS) that
  46. #     need to distinguish between the place where things
  47. #     get installed and where they finally will reside.
  48. # In each case, if your previous value was the default, leave it commented
  49. # out.  That way, if you override prefix, all of these will be
  50. # automatically adjusted.
  51. #
  52. # WARNING:  Be especially careful about architecture-dependent and
  53. # version-dependent names, particularly if you reuse this file for
  54. # different versions of perl.
  55.  
  56. !GROK!THIS!
  57.  
  58. for var in bin scriptdir privlib archlib \
  59.     man1dir man3dir sitelib sitearch \
  60.     installbin installscript installprivlib installarchlib \
  61.     installman1dir installman3dir installsitelib installsitearch \
  62.     man1ext man3ext; do
  63.     
  64.     case "$var" in
  65.     bin)    dflt=$prefix/bin ;;
  66.     # The scriptdir test is more complex, but this is probably usually ok.
  67.     scriptdir)
  68.     if $test -d $prefix/script; then
  69.         dflt=$prefix/script
  70.     else
  71.         dflt=$bin
  72.     fi
  73.     ;;
  74.     privlib)
  75.     case "$prefix" in
  76.     *perl*)    dflt=$prefix/lib/$version ;;
  77.     *)    dflt=$prefix/lib/$package/$version ;;
  78.     esac
  79.     ;;
  80.     archlib)    
  81.     case "$prefix" in
  82.     *perl*)    dflt=$prefix/lib/$version/$archname ;;
  83.     *)    dflt=$prefix/lib/$package/$version/$archname ;;
  84.     esac
  85.     ;;
  86.     sitelib)
  87.     case "$prefix" in
  88.     *perl*)    dflt=$prefix/lib/site_perl/$apiversion ;;
  89.     *)    dflt=$prefix/lib/$package/site_perl/$apiversion ;;
  90.     esac
  91.     ;;
  92.     sitearch)    
  93.     case "$prefix" in
  94.     *perl*)    dflt=$prefix/lib/site_perl/$apiversion/$archname ;;
  95.     *)    dflt=$prefix/lib/$package/site_perl/$apiversion/$archname ;;
  96.     esac
  97.     ;;
  98.     man1dir)    dflt="$prefix/man/man1" ;;
  99.     man3dir)
  100.     case "$prefix" in
  101.     *perl*) dflt=`echo $man1dir |
  102.             sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
  103.     *)    dflt=$privlib/man/man3 ;;
  104.     esac
  105.     ;;
  106.  
  107.     # Can we assume all sed's have greedy matching?
  108.     man1ext)    dflt=`echo $man1dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
  109.     man3ext)    dflt=`echo $man3dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
  110.  
  111.     # It might be possible to fool these next tests.  Please let
  112.     # me know if they don't work right for you.
  113.     installbin)        dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
  114.     installscript)    dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
  115.     installprivlib)    dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
  116.     installarchlib)    dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
  117.     installsitelib)    dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
  118.     installsitearch)    dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
  119.     installman1dir)    dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
  120.     installman3dir)    dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
  121.     esac
  122.     
  123.     eval val="\$$var"
  124.     if test X"$val" = X"$dflt"; then
  125.     echo "# $var='$dflt'"
  126.     else
  127.     echo "# Preserving custom $var"
  128.     echo "$var='$val'"
  129.     fi
  130.  
  131. done >> Policy.sh
  132.  
  133. $spitshell <<!GROK!THIS! >>Policy.sh
  134.  
  135. #  Lastly, you may add additional items here.  For example, to set the
  136. #  pager to your local favorite value, uncomment the following line in
  137. #  the original Policy_sh.SH file and re-run   sh Policy_sh.SH.
  138. #
  139. #  pager='$pager'
  140. #
  141. #  A full Glossary of all the config.sh variables is in the file
  142. #  Porting/Glossary.
  143.  
  144. !GROK!THIS!
  145.  
  146. #Credits:
  147. #   The original design for this Policy.sh file came from Wayne Davison,
  148. #   maintainer of trn.
  149. #   This version for Perl5.004_61 originally written by
  150. #   Andy Dougherty <doughera@lafcol.lafayette.edu>.
  151. #   This file may be distributed under the same terms as Perl itself.
  152.  
  153.